package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 商品实体类
 */
@Data
@NoArgsConstructor
@TableName("t_product")
public class ProductBean {
    @TableId(value = "pk_productId",type = IdType.AUTO)
    private Integer id;
    @TableField("p_name")
    private String name;
    /**
     * 品牌
     */
    @TableField("p_brand")
    private String brand;

    @TableField("p_type")
    private String type;

    @TableField("p_imgPath")
    private String imgPath;

    @TableField("p_buyPrice")
    private Integer buyPrice;

    @TableField("p_salePrice")
    private Integer salePrice;

    /**
     * 库存数量
     */
    @TableField("p_num")
    private Integer num;

    public ProductBean(Integer id, String name, String brand, String type, String imgPath) {
        this.id = id;
        this.name = name;
        this.brand = brand;
        this.type = type;
        this.imgPath = imgPath;
    }

    @Override
    public String toString() {
        return "ProductBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", brand='" + brand + '\'' +
                ", type='" + type + '\'' +
                ", imgPath='" + imgPath + '\'' +
                ", buyPrice=" + buyPrice +
                ", salePrice=" + salePrice +
                ", num=" + num +
                '}'+"\n";
    }
}
